import { Catch } from "@midwayjs/core/dist";
import { Context } from "@midwayjs/koa/dist";
import { Resultes } from "../interface";

@Catch()
export class DefaultErrorFilter {
  // 所有的未分类错误会到这里
  async catch(err, ctx: Context) {
    return Resultes.fail(err.message, err.code);
  }
}
